package com.qdc.datacenters.client;

import com.dtflys.forest.annotation.*;
import com.qdc.datacenters.domain.QwResultVo;
import com.qdc.datacenters.domain.query.qw.QwUserQuery;
import com.qdc.datacenters.domain.vo.qw.QwLoginUserVo;
import com.qdc.datacenters.domain.vo.qw.QwUserDetailVo;
import com.qdc.datacenters.handler.QwCommonRetryWhenHandler;
import com.qdc.datacenters.interceptor.forest.AgentAccessTokenInterceptor;

/**
 * @author danmo
 * @Description 成员管理接口
 * @date 2024/02/27 15:28
 **/
@BaseRequest(baseURL = "${qwServerUrl}")
@Retry(maxRetryCount = "3", maxRetryInterval = "1000", condition = QwCommonRetryWhenHandler.class)
public interface CorpUserClient {
    /**
     * 读取成员
     *
     * @param query
     * @return WeUserDetailVo
     */
    @Get(url = "/user/get?userid=${query.userid}", interceptor = AgentAccessTokenInterceptor.class)
    QwUserDetailVo getUserInfo(@Var("query") QwUserQuery query);

    /**
     * 删除成员
     *
     * @param query
     * @return QwResultVo
     */
    @Get(url = "/user/delete?userid=${query.userid}", interceptor = AgentAccessTokenInterceptor.class)
    QwResultVo delUser(@Var("query") QwUserQuery query);

    /**
     * 批量删除成员
     *
     * @param query
     * @return QwResultVo
     */
    @Post(url = "/user/batchdelete", interceptor = AgentAccessTokenInterceptor.class)
    QwResultVo batchDelUser(@JSONBody QwUserQuery query);

    /**
     * 获取访问用户身份
     *
     * @param query
     * @return WeLoginUserVo
     */
    @Get(url = "/auth/getuserinfo?code=${query.code}", interceptor = AgentAccessTokenInterceptor.class)
    QwLoginUserVo getLoginUser(@Var("query") QwUserQuery query);

    /**
     * 获取访问用户敏感信息
     *
     * @param query
     * @return
     */
    @Post(url = "/auth/getuserdetail", interceptor = AgentAccessTokenInterceptor.class)
    QwUserDetailVo getUserSensitiveInfo(@JSONBody QwUserQuery query);


}
